<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./Ajax.js"></script>
</head>

<body>
    <script>
        let p = pAjax({
            url: '../5.1data1.php',
        });
        // console.log(p);
        p.then(function (res) {

            let p1 = pAjax({
                url: '../5.2data2.php',
                data: {
                    data1: res,
                },
            });
            return p1;
            
        })
        .then(res2=>{
            let p1 = pAjax({
                url: '../5.3data3.php',
                data: {
                    data2: res2,
                },
            });
            return p1;
        })
        .then(res3=>{
            console.log(res3);
        });
        
    </script>
</body>

</html>